/*******************************************************************************
* Copyright (c) 2010, 2018 西安秦晔信息科技有限公司
* Licensed under the Apache License, Version 2.0 (the "License");
*    you may not use this file except in compliance with the License.
*    You may obtain a copy of the License at
*
*       http://www.apache.org/licenses/LICENSE-2.0
*
*    Unless required by applicable law or agreed to in writing, software
*    distributed under the License is distributed on an "AS IS" BASIS,
*    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*    See the License for the specific language governing permissions and
*    limitations under the License.
*******************************************************************************/
package com.qinyeit.serviceapp.entity;

import com.qinyeit.serviceapp.entity.enums.MemberMakeCardType;
import com.qinyeit.serviceapp.entity.enums.PeriodType;
import lombok.Builder;
import lombok.experimental.Tolerate;

import javax.persistence.*;

/**
 * ClassName: BatchCardRecord <br/>
 * Function: 批量制卡记录 <br/>
 * date: 2018-12-04 11:14:20 <br/>
 *
 * @author liuwenjin
 * @version  1.0
 * @since JDK 1.8
 */
@Builder
@Entity
@Table(name="batch_card_records")
public class BatchCardRecord extends MerchantGroupBaseEntity<Long> {

	private static final long serialVersionUID = 1L;

	// 卡类型
	@ManyToOne
    @JoinColumn(name="card_type_id")
	private MemberCardType cardType = null;

	// 前缀 
    @Column(name="card_pre", length = 300)
	private String cardPre = null;

	// 起始编号 
    @Column(name="start_no", length = 300)
	private String startNo = null;

	// 制卡数量 
    @Column(name="count")
	private Integer count = 0;

	// 办卡押金 
    @Column(name="deposit",scale=2)
	private Double deposit = 0d;

	// 有效期 
    @Column(name="period", length = 300)
	@Enumerated(EnumType.STRING)
	private PeriodType period = PeriodType.LONGTERM;

	// 已配送数量
    @Column(name="deliver_count")
	private Integer deliverCount = 0;

	// 卡号
	@Column(name="no")
	private String no = "";

	//去除尾数 （保存提交 json数组[1,3]）
	@Transient
	private String exclude = "";


	// 会员卡片类型
	@Column(name="make_card_type")
	@Enumerated(EnumType.STRING)
	private MemberMakeCardType makeCardType = MemberMakeCardType.VIRTUALCARD;



    @Tolerate
	public BatchCardRecord() {
		
	}
    @Tolerate
	public BatchCardRecord(Long id){
    	super.setId(id);
    }

	public MemberCardType getCardType() {
		return cardType;
	}

	public void setCardType(MemberCardType cardType) {
		this.cardType = cardType;
	}

	/**
	 * 获取前缀
	 */
	public String getCardPre() {
		return this.cardPre;
	}

    /**
     * 设置前缀
     */
	public BatchCardRecord setCardPre(String cardPre) {
		this.cardPre = cardPre;
		return this;
	}

	/**
	 * 获取起始编号
	 */
	public String getStartNo() {
		return this.startNo;
	}

    /**
     * 设置起始编号
     */
	public BatchCardRecord setStartNo(String startNo) {
		this.startNo = startNo;
		return this;
	}

	/**
	 * 获取制卡数量
	 */
	public Integer getCount() {
		return this.count;
	}

    /**
     * 设置制卡数量
     */
	public BatchCardRecord setCount(Integer count) {
		this.count = count;
		return this;
	}

	/**
	 * 获取办卡押金
	 */
	public Double getDeposit() {
		return this.deposit;
	}

    /**
     * 设置办卡押金
     */
	public BatchCardRecord setDeposit(Double deposit) {
		this.deposit = deposit;
		return this;
	}

	public PeriodType getPeriod() {
		return period;
	}

	public void setPeriod(PeriodType period) {
		this.period = period;
	}

	/**
	 * 获取已配送数量
	 */
	public Integer getDeliverCount() {
		return this.deliverCount;
	}

    /**
     * 设置已配送数量
     */
	public BatchCardRecord setDeliverCount(Integer deliverCount) {
		this.deliverCount = deliverCount;
		return this;
	}

	public String getExclude() {
		return exclude;
	}

	public void setExclude(String exclude) {
		this.exclude = exclude;
	}

	public String getNo() {
		return no;
	}

	public void setNo(String no) {
		this.no = no;
	}

	public MemberMakeCardType getMakeCardType() {
		return makeCardType;
	}

	public void setMakeCardType(MemberMakeCardType makeCardType) {
		this.makeCardType = makeCardType;
	}
}
